package com.gblfy.email.emailtest;

import com.gblfy.email.dto.Emailsubject;
import com.gblfy.email.util.EmailUtils;
import org.junit.Test;

public class EmailTest {

    @Test
    public void checkInformEmailNoticeTest() throws Exception {
        //测试模拟数据
        Emailsubject emailsubject = new Emailsubject();
        emailsubject.setSendEmail("xxx@xxx.com");
        emailsubject.setProxyserverHost("192.168.xxx.xxx");
        emailsubject.setSendEmailPwd("gblfy.com");
        emailsubject.setReceiveEmail("xxx@xxx.com");
        emailsubject.setCcEmail("xxx@xxx.com.cn,xxx@xxx.com.cn,xxx@xxx.com.cn,xxx@xxx.com.cn");

        String msg = EmailUtils.checkInformEmailNotice("运维人员", 5, 5, "0123456IC20211012000001,0123456IC20211012000002",
                "IC20211012000002", "0123456IC20211012000004,0123456IC20211012000005 ", emailsubject.getProxyserverHost(),
                emailsubject.getSendEmail(), emailsubject.getSendEmailPwd(), emailsubject.getReceiveEmail(), emailsubject.getCcEmail(), null);
        System.out.println("msg" + msg);
    }

    @Test
    public void loadEmailNoticeTest() throws Exception {
        //测试模拟数据
        Emailsubject emailsubject = new Emailsubject();
        emailsubject.setSendEmail("xxx@xxx.com");
        emailsubject.setProxyserverHost("192.168.xxx.xxx");
        emailsubject.setSendEmailPwd("gblfy.com");
        emailsubject.setReceiveEmail("xxx@xxx.com");
        emailsubject.setCcEmail("xxx@xxx.com.cn,xxx@xxx.com.cn,xxx@xxx.com.cn,xxx@xxx.com.cn");

        String msg = EmailUtils.loadEmailNotice("运维人员", 5, 5, "0123456IC20211012000001,0123456IC20211012000002",
                "IC20211012000002", "0123456IC20211012000004,0123456IC20211012000005 ", "0123456IC20211012000008", emailsubject.getProxyserverHost(),
                emailsubject.getSendEmail(), emailsubject.getSendEmailPwd(), emailsubject.getReceiveEmail(), emailsubject.getCcEmail(), null);
        System.out.println("msg" + msg);
    }
}
